import React,{useState} from "react";

export default function Search(props) {
    let [type,setType] = useState("name");
    let [value,setValue] = useState("");
    const handleSearch = () => {
        console.log(type,value);
        props.show({type,value,current:1,pageSize:5});
    }
    return (
        <div>
            <select onChange={(e) => setType(e.target.value)}>
                <option value="name">姓名</option>
                <option value="gender">性别</option>
                <option value="age">年龄</option>
            </select>
            <input type="text" onChange={(e) => setValue(e.target.value)}/>
            <input type="button" value="搜索" onClick={handleSearch}/>
        </div>
    );
} 
